import {defHttp} from '/@/utils/http/axios';


enum Api {
  list = '/tobedoneAnnualKeyWork/tobedoneAnnualKeyWork/list',
  receiveTask = '/tobedoneAnnualKeyWork/tobedoneAnnualKeyWork/receiveTask',
  refuseTask = '/tobedoneAnnualKeyWork/tobedoneAnnualKeyWork/refuseTask',
}
/**
 * 列表接口
 * @param params
 */
export const list = (params) =>
  defHttp.get({url: Api.list, params});


/**
 * 接收任务
 * @param params
 */
export const receiveTask = (params, handleSuccess) => {
  return defHttp.post({url: Api.receiveTask, params}).then(() => {
    handleSuccess();
  });
}

/**
 * 驳回任务
 * @param params
 */
export const refuseTask = (params, handleSuccess) => {
  return defHttp.post({url: Api.refuseTask, params}).then(() => {
    handleSuccess();
  });
}
